package cn.didi.feidi.androidorder.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;

import cn.didi.feidi.androidorder.fragment.FeiDiMainBaseFragment;

/**
 * Created by jinxiong on 2017/8/19.
 */

public class MainViewPagerAdapter extends FragmentPagerAdapter {


    ArrayList<FeiDiMainBaseFragment> fragments;

    public MainViewPagerAdapter(FragmentManager fm, ArrayList<FeiDiMainBaseFragment> fragments) {
        super(fm);
        this.fragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }


}
